import homeRoutes from '../../router/homeRoutes/index'//路由表
import { filterRoute } from '../../utils/filterRoute'
import router from '../../router'

const state = {
    filterList:[]
}

const mutations = {
    filterAuth(state, userInfo) {
        let res = filterRoute(homeRoutes, userInfo)
        state.filterList = res
        localStorage.setItem('list', JSON.stringify(res))
        router.addRoutes(res)
        router.push(res[0].path)
    }
}

const actions = {

}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}